package com.base.admin.util;


import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson2.JSONObject;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author rqq
 */
public class ServletUtils {

    public static void writeJson(Object object, HttpServletResponse response) throws IOException {
        response.setCharacterEncoding("utf-8");
        ServletUtil.write(response, JSONObject.toJSONString(object), "application/json");
    }
}
